define(
	[
		'require',
		'zrender/tool/util',
		'apm/ui/business_chart_line',
		'apm/ui/business_map'
	],
	function(require){

		APM.BusinessDetailExperienceDefaultView = Ember.View.extend({
			indicatorChart: require("apm/ui/business_chart_line"),

			MapChart: require('apm/ui/business_map'),

			didInsertElement: function(){
				this.get("controller").startRealTimeMode();
				this.get("controller").requirePerformances();
				this.connectCharts();
			},

			willDestroyElement: function(){
				this.get("controller").stopRealTimeMode();
			},

			connectCharts: function(){
				var businessDetailGaugeChart1 = Broada.getView("expPerfScoreView");
				var businessDetailGaugeChart2 = Broada.getView("expResponseTimeView");
				var businessDetailGaugeChart3 = Broada.getView("expResponseUniqueView");
				var businessDetailGaugeChart4 = Broada.getView("expResponseRateView");
				var businessDetailGaugeChart5 = Broada.getView("expRequestView");
				if(businessDetailGaugeChart1&&businessDetailGaugeChart2
					&&businessDetailGaugeChart3&&businessDetailGaugeChart4) {
					var chart1 = businessDetailGaugeChart1.chart;
					var chart2 = businessDetailGaugeChart2.chart;
					var chart3 = businessDetailGaugeChart3.chart;
					var chart4 = businessDetailGaugeChart4.chart;
					var chart5 = businessDetailGaugeChart5.chart;
					chart1.connect([chart2,chart3,chart4,chart5]);
					chart2.connect([chart1,chart3,chart4,chart5]);
					chart3.connect([chart1,chart2,chart4,chart5]);
					chart4.connect([chart1,chart2,chart3,chart5]);
					chart5.connect([chart1,chart2,chart3,chart4]);
				}
			}
		});
	}
);